import { Modal as AntdModel } from 'antd';
import { useState, PropsWithChildren, useContext } from 'react';
import { FormContainer } from './form-container';
import { Ctx } from './ctx';
export function Modal(props: PropsWithChildren<{title: string}>) {
    let {formInstance, onCancel} = useContext(Ctx);
    return (
        <AntdModel visible={true} title={props.title} onOk={() => {
            formInstance.submit();
        }} onCancel={onCancel}>
            {props.children}
        </AntdModel>
    );
}